{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 工资标准\n",
    "1. 底薪: 2000元\n",
    "2. 直接成单: 奖励100元\n",
    "3. 跟单成功: 奖励80元\n",
    "4. 直接成单数最高者: 奖励2000元\n",
    "5. 跟单成功率最高者: 奖励1600元\n",
    "6. 跟单成功数最高者: 奖励1600元\n",
    "7. 总成单数最高者: 奖励3000元\n",
    "8. 总成单率最高者: 奖励3000元"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sqlalchemy\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sqlalchemy import create_engine\n",
    "conn = create_engine('mysql+pymysql://root:12345@localhost:3306/recommend2?charset=utf8')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单书</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>总成单率</th>\n",
       "      <th>非意向用户数</th>\n",
       "      <th>跟单失败数</th>\n",
       "      <th>非意向用户率</th>\n",
       "      <th>跟单失败率</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1075</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0614</td>\n",
       "      <td>0.0335</td>\n",
       "      <td>0.0949</td>\n",
       "      <td>431</td>\n",
       "      <td>148</td>\n",
       "      <td>0.4009</td>\n",
       "      <td>0.1377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1040</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0519</td>\n",
       "      <td>0.0154</td>\n",
       "      <td>0.0673</td>\n",
       "      <td>515</td>\n",
       "      <td>197</td>\n",
       "      <td>0.4952</td>\n",
       "      <td>0.1894</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1056</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0426</td>\n",
       "      <td>0.0133</td>\n",
       "      <td>0.0559</td>\n",
       "      <td>385</td>\n",
       "      <td>163</td>\n",
       "      <td>0.3646</td>\n",
       "      <td>0.1544</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>1006</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0358</td>\n",
       "      <td>0.0149</td>\n",
       "      <td>0.0507</td>\n",
       "      <td>433</td>\n",
       "      <td>144</td>\n",
       "      <td>0.4304</td>\n",
       "      <td>0.1431</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1038</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0289</td>\n",
       "      <td>0.0308</td>\n",
       "      <td>0.0597</td>\n",
       "      <td>419</td>\n",
       "      <td>143</td>\n",
       "      <td>0.4037</td>\n",
       "      <td>0.1378</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   销售id 销售姓名  沟通用户总数  直接成单书  跟单成功数  总成单数   直接成单率   跟单成功率    总成单率  非意向用户数  \\\n",
       "0     1   张艳    1075     66     36   102  0.0614  0.0335  0.0949     431   \n",
       "1     2   李勇    1040     54     16    70  0.0519  0.0154  0.0673     515   \n",
       "2     3   王平    1056     45     14    59  0.0426  0.0133  0.0559     385   \n",
       "3     4   李强    1006     36     15    51  0.0358  0.0149  0.0507     433   \n",
       "4     5   王芳    1038     30     32    62  0.0289  0.0308  0.0597     419   \n",
       "\n",
       "   跟单失败数  非意向用户率   跟单失败率  \n",
       "0    148  0.4009  0.1377  \n",
       "1    197  0.4952  0.1894  \n",
       "2    163  0.3646  0.1544  \n",
       "3    144  0.4304  0.1431  \n",
       "4    143  0.4037  0.1378  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data = pd.read_sql(\n",
    "    'select * from v1;',\n",
    "    conn,\n",
    ")\n",
    "df_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data['底薪'] = 2000\n",
    "df_data['直接成单奖励'] = 0\n",
    "df_data['跟单成功奖励'] = 0\n",
    "\n",
    "df_data['直接成单数最高者奖励'] = 0\n",
    "df_data['跟单成功率最高者奖励'] = 0\n",
    "df_data['跟单成功数最高者奖励'] = 0\n",
    "df_data['总成单数最高者奖励'] = 0\n",
    "df_data['总成单率最高者奖励'] = 0\n",
    "\n",
    "df_data['总工资'] = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['销售id', '销售姓名', '沟通用户总数', '直接成单书', '跟单成功数', '总成单数', '直接成单率', '跟单成功率',\n",
       "       '总成单率', '非意向用户数', '跟单失败数', '非意向用户率', '跟单失败率', '底薪', '直接成单奖励', '跟单成功奖励',\n",
       "       '直接成单数最高者奖励', '跟单成功率最高者奖励', '跟单成功数最高者奖励', '总成单数最高者奖励', '总成单率最高者奖励',\n",
       "       '总工资'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "16 10 10 28 28\n"
     ]
    }
   ],
   "source": [
    "index1 = df_data['直接成单书'].sort_values(ascending=False).index.tolist()[0]\n",
    "index2 = df_data['跟单成功率'].sort_values(ascending=False).index.tolist()[0]\n",
    "index3 = df_data['跟单成功数'].sort_values(ascending=False).index.tolist()[0]\n",
    "index4 = df_data['总成单数'].sort_values(ascending=False).index.tolist()[0]\n",
    "index5 = df_data['总成单率'].sort_values(ascending=False).index.tolist()[0]\n",
    "print(index1, index2, index3, index4, index5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data.loc[index1,'直接成单数最高者奖励'] = 2000\n",
    "df_data.loc[index2, '跟单成功率最高者奖励'] = 1600\n",
    "df_data.loc[index3,'跟单成功数最高者奖励'] = 1600\n",
    "df_data.loc[index4, '总成单数最高者奖励'] = 3000\n",
    "df_data.loc[index5, '总成单率最高者奖励'] = 3000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data['直接成单奖励'] = df_data['直接成单书'] * 100\n",
    "df_data['跟单成功奖励'] = df_data['跟单成功数'] * 80"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单书</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>总成单率</th>\n",
       "      <th>非意向用户数</th>\n",
       "      <th>...</th>\n",
       "      <th>跟单失败率</th>\n",
       "      <th>底薪</th>\n",
       "      <th>直接成单奖励</th>\n",
       "      <th>跟单成功奖励</th>\n",
       "      <th>直接成单数最高者奖励</th>\n",
       "      <th>跟单成功率最高者奖励</th>\n",
       "      <th>跟单成功数最高者奖励</th>\n",
       "      <th>总成单数最高者奖励</th>\n",
       "      <th>总成单率最高者奖励</th>\n",
       "      <th>总工资</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1075</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0614</td>\n",
       "      <td>0.0335</td>\n",
       "      <td>0.0949</td>\n",
       "      <td>431</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1377</td>\n",
       "      <td>2000</td>\n",
       "      <td>6600</td>\n",
       "      <td>2880</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1040</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0519</td>\n",
       "      <td>0.0154</td>\n",
       "      <td>0.0673</td>\n",
       "      <td>515</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1894</td>\n",
       "      <td>2000</td>\n",
       "      <td>5400</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1056</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0426</td>\n",
       "      <td>0.0133</td>\n",
       "      <td>0.0559</td>\n",
       "      <td>385</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1544</td>\n",
       "      <td>2000</td>\n",
       "      <td>4500</td>\n",
       "      <td>1120</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>1006</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0358</td>\n",
       "      <td>0.0149</td>\n",
       "      <td>0.0507</td>\n",
       "      <td>433</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1431</td>\n",
       "      <td>2000</td>\n",
       "      <td>3600</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1038</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0289</td>\n",
       "      <td>0.0308</td>\n",
       "      <td>0.0597</td>\n",
       "      <td>419</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1378</td>\n",
       "      <td>2000</td>\n",
       "      <td>3000</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   销售id 销售姓名  沟通用户总数  直接成单书  跟单成功数  总成单数   直接成单率   跟单成功率    总成单率  非意向用户数 ...   \\\n",
       "0     1   张艳    1075     66     36   102  0.0614  0.0335  0.0949     431 ...    \n",
       "1     2   李勇    1040     54     16    70  0.0519  0.0154  0.0673     515 ...    \n",
       "2     3   王平    1056     45     14    59  0.0426  0.0133  0.0559     385 ...    \n",
       "3     4   李强    1006     36     15    51  0.0358  0.0149  0.0507     433 ...    \n",
       "4     5   王芳    1038     30     32    62  0.0289  0.0308  0.0597     419 ...    \n",
       "\n",
       "    跟单失败率    底薪  直接成单奖励  跟单成功奖励  直接成单数最高者奖励  跟单成功率最高者奖励  跟单成功数最高者奖励  \\\n",
       "0  0.1377  2000    6600    2880           0           0           0   \n",
       "1  0.1894  2000    5400    1280           0           0           0   \n",
       "2  0.1544  2000    4500    1120           0           0           0   \n",
       "3  0.1431  2000    3600    1200           0           0           0   \n",
       "4  0.1378  2000    3000    2560           0           0           0   \n",
       "\n",
       "   总成单数最高者奖励  总成单率最高者奖励  总工资  \n",
       "0          0          0    0  \n",
       "1          0          0    0  \n",
       "2          0          0    0  \n",
       "3          0          0    0  \n",
       "4          0          0    0  \n",
       "\n",
       "[5 rows x 22 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data['总工资'] = df_data['底薪']+df_data['直接成单奖励']+df_data['跟单成功奖励']+df_data['直接成单数最高者奖励']+df_data['跟单成功率最高者奖励']+df_data['跟单成功数最高者奖励']+df_data['总成单数最高者奖励']+df_data['总成单率最高者奖励']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单书</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>总成单率</th>\n",
       "      <th>非意向用户数</th>\n",
       "      <th>...</th>\n",
       "      <th>跟单失败率</th>\n",
       "      <th>底薪</th>\n",
       "      <th>直接成单奖励</th>\n",
       "      <th>跟单成功奖励</th>\n",
       "      <th>直接成单数最高者奖励</th>\n",
       "      <th>跟单成功率最高者奖励</th>\n",
       "      <th>跟单成功数最高者奖励</th>\n",
       "      <th>总成单数最高者奖励</th>\n",
       "      <th>总成单率最高者奖励</th>\n",
       "      <th>总工资</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1075</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0614</td>\n",
       "      <td>0.0335</td>\n",
       "      <td>0.0949</td>\n",
       "      <td>431</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1377</td>\n",
       "      <td>2000</td>\n",
       "      <td>6600</td>\n",
       "      <td>2880</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1040</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0519</td>\n",
       "      <td>0.0154</td>\n",
       "      <td>0.0673</td>\n",
       "      <td>515</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1894</td>\n",
       "      <td>2000</td>\n",
       "      <td>5400</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1056</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0426</td>\n",
       "      <td>0.0133</td>\n",
       "      <td>0.0559</td>\n",
       "      <td>385</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1544</td>\n",
       "      <td>2000</td>\n",
       "      <td>4500</td>\n",
       "      <td>1120</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7620</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>1006</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0358</td>\n",
       "      <td>0.0149</td>\n",
       "      <td>0.0507</td>\n",
       "      <td>433</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1431</td>\n",
       "      <td>2000</td>\n",
       "      <td>3600</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1038</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0289</td>\n",
       "      <td>0.0308</td>\n",
       "      <td>0.0597</td>\n",
       "      <td>419</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1378</td>\n",
       "      <td>2000</td>\n",
       "      <td>3000</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7560</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   销售id 销售姓名  沟通用户总数  直接成单书  跟单成功数  总成单数   直接成单率   跟单成功率    总成单率  非意向用户数  \\\n",
       "0     1   张艳    1075     66     36   102  0.0614  0.0335  0.0949     431   \n",
       "1     2   李勇    1040     54     16    70  0.0519  0.0154  0.0673     515   \n",
       "2     3   王平    1056     45     14    59  0.0426  0.0133  0.0559     385   \n",
       "3     4   李强    1006     36     15    51  0.0358  0.0149  0.0507     433   \n",
       "4     5   王芳    1038     30     32    62  0.0289  0.0308  0.0597     419   \n",
       "\n",
       "   ...     跟单失败率    底薪  直接成单奖励  跟单成功奖励  直接成单数最高者奖励  跟单成功率最高者奖励  跟单成功数最高者奖励  \\\n",
       "0  ...    0.1377  2000    6600    2880           0           0           0   \n",
       "1  ...    0.1894  2000    5400    1280           0           0           0   \n",
       "2  ...    0.1544  2000    4500    1120           0           0           0   \n",
       "3  ...    0.1431  2000    3600    1200           0           0           0   \n",
       "4  ...    0.1378  2000    3000    2560           0           0           0   \n",
       "\n",
       "   总成单数最高者奖励  总成单率最高者奖励    总工资  \n",
       "0          0          0  11480  \n",
       "1          0          0   8680  \n",
       "2          0          0   7620  \n",
       "3          0          0   6800  \n",
       "4          0          0   7560  \n",
       "\n",
       "[5 rows x 22 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>销售id</th>\n",
       "      <th>销售姓名</th>\n",
       "      <th>沟通用户总数</th>\n",
       "      <th>直接成单书</th>\n",
       "      <th>跟单成功数</th>\n",
       "      <th>总成单数</th>\n",
       "      <th>直接成单率</th>\n",
       "      <th>跟单成功率</th>\n",
       "      <th>总成单率</th>\n",
       "      <th>非意向用户数</th>\n",
       "      <th>...</th>\n",
       "      <th>跟单失败率</th>\n",
       "      <th>底薪</th>\n",
       "      <th>直接成单奖励</th>\n",
       "      <th>跟单成功奖励</th>\n",
       "      <th>直接成单数最高者奖励</th>\n",
       "      <th>跟单成功率最高者奖励</th>\n",
       "      <th>跟单成功数最高者奖励</th>\n",
       "      <th>总成单数最高者奖励</th>\n",
       "      <th>总成单率最高者奖励</th>\n",
       "      <th>总工资</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>29</td>\n",
       "      <td>李敏</td>\n",
       "      <td>1020</td>\n",
       "      <td>82</td>\n",
       "      <td>46</td>\n",
       "      <td>128</td>\n",
       "      <td>0.0804</td>\n",
       "      <td>0.0451</td>\n",
       "      <td>0.1255</td>\n",
       "      <td>469</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1441</td>\n",
       "      <td>2000</td>\n",
       "      <td>8200</td>\n",
       "      <td>3680</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3000</td>\n",
       "      <td>3000</td>\n",
       "      <td>19880</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>17</td>\n",
       "      <td>张杰</td>\n",
       "      <td>1059</td>\n",
       "      <td>84</td>\n",
       "      <td>19</td>\n",
       "      <td>103</td>\n",
       "      <td>0.0793</td>\n",
       "      <td>0.0179</td>\n",
       "      <td>0.0973</td>\n",
       "      <td>460</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1870</td>\n",
       "      <td>2000</td>\n",
       "      <td>8400</td>\n",
       "      <td>1520</td>\n",
       "      <td>2000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>张勇</td>\n",
       "      <td>1055</td>\n",
       "      <td>83</td>\n",
       "      <td>38</td>\n",
       "      <td>121</td>\n",
       "      <td>0.0787</td>\n",
       "      <td>0.0360</td>\n",
       "      <td>0.1147</td>\n",
       "      <td>371</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1327</td>\n",
       "      <td>2000</td>\n",
       "      <td>8300</td>\n",
       "      <td>3040</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13340</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>张秀英</td>\n",
       "      <td>1049</td>\n",
       "      <td>24</td>\n",
       "      <td>60</td>\n",
       "      <td>84</td>\n",
       "      <td>0.0229</td>\n",
       "      <td>0.0572</td>\n",
       "      <td>0.0801</td>\n",
       "      <td>406</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1354</td>\n",
       "      <td>2000</td>\n",
       "      <td>2400</td>\n",
       "      <td>4800</td>\n",
       "      <td>0</td>\n",
       "      <td>1600</td>\n",
       "      <td>1600</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>12400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>王强</td>\n",
       "      <td>1041</td>\n",
       "      <td>77</td>\n",
       "      <td>33</td>\n",
       "      <td>110</td>\n",
       "      <td>0.0740</td>\n",
       "      <td>0.0317</td>\n",
       "      <td>0.1057</td>\n",
       "      <td>455</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1547</td>\n",
       "      <td>2000</td>\n",
       "      <td>7700</td>\n",
       "      <td>2640</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>12340</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>张艳</td>\n",
       "      <td>1075</td>\n",
       "      <td>66</td>\n",
       "      <td>36</td>\n",
       "      <td>102</td>\n",
       "      <td>0.0614</td>\n",
       "      <td>0.0335</td>\n",
       "      <td>0.0949</td>\n",
       "      <td>431</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1377</td>\n",
       "      <td>2000</td>\n",
       "      <td>6600</td>\n",
       "      <td>2880</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11480</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>19</td>\n",
       "      <td>王丽</td>\n",
       "      <td>1042</td>\n",
       "      <td>59</td>\n",
       "      <td>41</td>\n",
       "      <td>100</td>\n",
       "      <td>0.0566</td>\n",
       "      <td>0.0393</td>\n",
       "      <td>0.0960</td>\n",
       "      <td>444</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1526</td>\n",
       "      <td>2000</td>\n",
       "      <td>5900</td>\n",
       "      <td>3280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20</td>\n",
       "      <td>王艳</td>\n",
       "      <td>1051</td>\n",
       "      <td>75</td>\n",
       "      <td>20</td>\n",
       "      <td>95</td>\n",
       "      <td>0.0714</td>\n",
       "      <td>0.0190</td>\n",
       "      <td>0.0904</td>\n",
       "      <td>440</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1817</td>\n",
       "      <td>2000</td>\n",
       "      <td>7500</td>\n",
       "      <td>1600</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>李伟</td>\n",
       "      <td>1050</td>\n",
       "      <td>71</td>\n",
       "      <td>24</td>\n",
       "      <td>95</td>\n",
       "      <td>0.0676</td>\n",
       "      <td>0.0229</td>\n",
       "      <td>0.0905</td>\n",
       "      <td>442</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1610</td>\n",
       "      <td>2000</td>\n",
       "      <td>7100</td>\n",
       "      <td>1920</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>11020</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>13</td>\n",
       "      <td>李军</td>\n",
       "      <td>1098</td>\n",
       "      <td>55</td>\n",
       "      <td>41</td>\n",
       "      <td>96</td>\n",
       "      <td>0.0501</td>\n",
       "      <td>0.0373</td>\n",
       "      <td>0.0874</td>\n",
       "      <td>430</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1694</td>\n",
       "      <td>2000</td>\n",
       "      <td>5500</td>\n",
       "      <td>3280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10780</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>30</td>\n",
       "      <td>张敏</td>\n",
       "      <td>1052</td>\n",
       "      <td>65</td>\n",
       "      <td>25</td>\n",
       "      <td>90</td>\n",
       "      <td>0.0618</td>\n",
       "      <td>0.0238</td>\n",
       "      <td>0.0856</td>\n",
       "      <td>404</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1663</td>\n",
       "      <td>2000</td>\n",
       "      <td>6500</td>\n",
       "      <td>2000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>27</td>\n",
       "      <td>王伟</td>\n",
       "      <td>1033</td>\n",
       "      <td>61</td>\n",
       "      <td>23</td>\n",
       "      <td>84</td>\n",
       "      <td>0.0591</td>\n",
       "      <td>0.0223</td>\n",
       "      <td>0.0813</td>\n",
       "      <td>442</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1568</td>\n",
       "      <td>2000</td>\n",
       "      <td>6100</td>\n",
       "      <td>1840</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9940</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>22</td>\n",
       "      <td>王超</td>\n",
       "      <td>1039</td>\n",
       "      <td>51</td>\n",
       "      <td>32</td>\n",
       "      <td>83</td>\n",
       "      <td>0.0491</td>\n",
       "      <td>0.0308</td>\n",
       "      <td>0.0799</td>\n",
       "      <td>545</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1809</td>\n",
       "      <td>2000</td>\n",
       "      <td>5100</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9660</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>15</td>\n",
       "      <td>张涛</td>\n",
       "      <td>1061</td>\n",
       "      <td>58</td>\n",
       "      <td>22</td>\n",
       "      <td>80</td>\n",
       "      <td>0.0547</td>\n",
       "      <td>0.0207</td>\n",
       "      <td>0.0754</td>\n",
       "      <td>513</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1828</td>\n",
       "      <td>2000</td>\n",
       "      <td>5800</td>\n",
       "      <td>1760</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9560</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>23</td>\n",
       "      <td>王杰</td>\n",
       "      <td>1048</td>\n",
       "      <td>32</td>\n",
       "      <td>48</td>\n",
       "      <td>80</td>\n",
       "      <td>0.0305</td>\n",
       "      <td>0.0458</td>\n",
       "      <td>0.0763</td>\n",
       "      <td>514</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1574</td>\n",
       "      <td>2000</td>\n",
       "      <td>3200</td>\n",
       "      <td>3840</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>9040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>25</td>\n",
       "      <td>李静</td>\n",
       "      <td>1036</td>\n",
       "      <td>47</td>\n",
       "      <td>28</td>\n",
       "      <td>75</td>\n",
       "      <td>0.0454</td>\n",
       "      <td>0.0270</td>\n",
       "      <td>0.0724</td>\n",
       "      <td>453</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1641</td>\n",
       "      <td>2000</td>\n",
       "      <td>4700</td>\n",
       "      <td>2240</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8940</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>刘洋</td>\n",
       "      <td>1053</td>\n",
       "      <td>46</td>\n",
       "      <td>29</td>\n",
       "      <td>75</td>\n",
       "      <td>0.0437</td>\n",
       "      <td>0.0275</td>\n",
       "      <td>0.0712</td>\n",
       "      <td>411</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1510</td>\n",
       "      <td>2000</td>\n",
       "      <td>4600</td>\n",
       "      <td>2320</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>18</td>\n",
       "      <td>张静</td>\n",
       "      <td>1050</td>\n",
       "      <td>56</td>\n",
       "      <td>16</td>\n",
       "      <td>72</td>\n",
       "      <td>0.0533</td>\n",
       "      <td>0.0152</td>\n",
       "      <td>0.0686</td>\n",
       "      <td>404</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1610</td>\n",
       "      <td>2000</td>\n",
       "      <td>5600</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8880</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>王军</td>\n",
       "      <td>1069</td>\n",
       "      <td>50</td>\n",
       "      <td>22</td>\n",
       "      <td>72</td>\n",
       "      <td>0.0468</td>\n",
       "      <td>0.0206</td>\n",
       "      <td>0.0674</td>\n",
       "      <td>476</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1796</td>\n",
       "      <td>2000</td>\n",
       "      <td>5000</td>\n",
       "      <td>1760</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>李勇</td>\n",
       "      <td>1040</td>\n",
       "      <td>54</td>\n",
       "      <td>16</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0519</td>\n",
       "      <td>0.0154</td>\n",
       "      <td>0.0673</td>\n",
       "      <td>515</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1894</td>\n",
       "      <td>2000</td>\n",
       "      <td>5400</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8680</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>16</td>\n",
       "      <td>刘芳</td>\n",
       "      <td>1064</td>\n",
       "      <td>50</td>\n",
       "      <td>19</td>\n",
       "      <td>69</td>\n",
       "      <td>0.0470</td>\n",
       "      <td>0.0179</td>\n",
       "      <td>0.0648</td>\n",
       "      <td>440</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1598</td>\n",
       "      <td>2000</td>\n",
       "      <td>5000</td>\n",
       "      <td>1520</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>王勇</td>\n",
       "      <td>1065</td>\n",
       "      <td>43</td>\n",
       "      <td>27</td>\n",
       "      <td>70</td>\n",
       "      <td>0.0404</td>\n",
       "      <td>0.0254</td>\n",
       "      <td>0.0657</td>\n",
       "      <td>504</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1897</td>\n",
       "      <td>2000</td>\n",
       "      <td>4300</td>\n",
       "      <td>2160</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8460</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>王平</td>\n",
       "      <td>1056</td>\n",
       "      <td>45</td>\n",
       "      <td>14</td>\n",
       "      <td>59</td>\n",
       "      <td>0.0426</td>\n",
       "      <td>0.0133</td>\n",
       "      <td>0.0559</td>\n",
       "      <td>385</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1544</td>\n",
       "      <td>2000</td>\n",
       "      <td>4500</td>\n",
       "      <td>1120</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7620</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>王芳</td>\n",
       "      <td>1038</td>\n",
       "      <td>30</td>\n",
       "      <td>32</td>\n",
       "      <td>62</td>\n",
       "      <td>0.0289</td>\n",
       "      <td>0.0308</td>\n",
       "      <td>0.0597</td>\n",
       "      <td>419</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1378</td>\n",
       "      <td>2000</td>\n",
       "      <td>3000</td>\n",
       "      <td>2560</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7560</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>24</td>\n",
       "      <td>张丽</td>\n",
       "      <td>1040</td>\n",
       "      <td>43</td>\n",
       "      <td>15</td>\n",
       "      <td>58</td>\n",
       "      <td>0.0413</td>\n",
       "      <td>0.0144</td>\n",
       "      <td>0.0558</td>\n",
       "      <td>572</td>\n",
       "      <td>...</td>\n",
       "      <td>0.2125</td>\n",
       "      <td>2000</td>\n",
       "      <td>4300</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>28</td>\n",
       "      <td>王秀兰</td>\n",
       "      <td>1028</td>\n",
       "      <td>42</td>\n",
       "      <td>15</td>\n",
       "      <td>57</td>\n",
       "      <td>0.0409</td>\n",
       "      <td>0.0146</td>\n",
       "      <td>0.0554</td>\n",
       "      <td>491</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1722</td>\n",
       "      <td>2000</td>\n",
       "      <td>4200</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>14</td>\n",
       "      <td>王娟</td>\n",
       "      <td>1045</td>\n",
       "      <td>25</td>\n",
       "      <td>31</td>\n",
       "      <td>56</td>\n",
       "      <td>0.0239</td>\n",
       "      <td>0.0297</td>\n",
       "      <td>0.0536</td>\n",
       "      <td>462</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1550</td>\n",
       "      <td>2000</td>\n",
       "      <td>2500</td>\n",
       "      <td>2480</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6980</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>21</td>\n",
       "      <td>张磊</td>\n",
       "      <td>1044</td>\n",
       "      <td>27</td>\n",
       "      <td>28</td>\n",
       "      <td>55</td>\n",
       "      <td>0.0259</td>\n",
       "      <td>0.0268</td>\n",
       "      <td>0.0527</td>\n",
       "      <td>552</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1887</td>\n",
       "      <td>2000</td>\n",
       "      <td>2700</td>\n",
       "      <td>2240</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6940</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>李强</td>\n",
       "      <td>1006</td>\n",
       "      <td>36</td>\n",
       "      <td>15</td>\n",
       "      <td>51</td>\n",
       "      <td>0.0358</td>\n",
       "      <td>0.0149</td>\n",
       "      <td>0.0507</td>\n",
       "      <td>433</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1431</td>\n",
       "      <td>2000</td>\n",
       "      <td>3600</td>\n",
       "      <td>1200</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>26</td>\n",
       "      <td>王敏</td>\n",
       "      <td>1081</td>\n",
       "      <td>32</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>0.0296</td>\n",
       "      <td>0.0148</td>\n",
       "      <td>0.0444</td>\n",
       "      <td>491</td>\n",
       "      <td>...</td>\n",
       "      <td>0.1850</td>\n",
       "      <td>2000</td>\n",
       "      <td>3200</td>\n",
       "      <td>1280</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>6480</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>30 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    销售id 销售姓名  沟通用户总数  直接成单书  跟单成功数  总成单数   直接成单率   跟单成功率    总成单率  非意向用户数  \\\n",
       "28    29   李敏    1020     82     46   128  0.0804  0.0451  0.1255     469   \n",
       "16    17   张杰    1059     84     19   103  0.0793  0.0179  0.0973     460   \n",
       "8      9   张勇    1055     83     38   121  0.0787  0.0360  0.1147     371   \n",
       "10    11  张秀英    1049     24     60    84  0.0229  0.0572  0.0801     406   \n",
       "11    12   王强    1041     77     33   110  0.0740  0.0317  0.1057     455   \n",
       "0      1   张艳    1075     66     36   102  0.0614  0.0335  0.0949     431   \n",
       "18    19   王丽    1042     59     41   100  0.0566  0.0393  0.0960     444   \n",
       "19    20   王艳    1051     75     20    95  0.0714  0.0190  0.0904     440   \n",
       "6      7   李伟    1050     71     24    95  0.0676  0.0229  0.0905     442   \n",
       "12    13   李军    1098     55     41    96  0.0501  0.0373  0.0874     430   \n",
       "29    30   张敏    1052     65     25    90  0.0618  0.0238  0.0856     404   \n",
       "26    27   王伟    1033     61     23    84  0.0591  0.0223  0.0813     442   \n",
       "21    22   王超    1039     51     32    83  0.0491  0.0308  0.0799     545   \n",
       "14    15   张涛    1061     58     22    80  0.0547  0.0207  0.0754     513   \n",
       "22    23   王杰    1048     32     48    80  0.0305  0.0458  0.0763     514   \n",
       "24    25   李静    1036     47     28    75  0.0454  0.0270  0.0724     453   \n",
       "7      8   刘洋    1053     46     29    75  0.0437  0.0275  0.0712     411   \n",
       "17    18   张静    1050     56     16    72  0.0533  0.0152  0.0686     404   \n",
       "5      6   王军    1069     50     22    72  0.0468  0.0206  0.0674     476   \n",
       "1      2   李勇    1040     54     16    70  0.0519  0.0154  0.0673     515   \n",
       "15    16   刘芳    1064     50     19    69  0.0470  0.0179  0.0648     440   \n",
       "9     10   王勇    1065     43     27    70  0.0404  0.0254  0.0657     504   \n",
       "2      3   王平    1056     45     14    59  0.0426  0.0133  0.0559     385   \n",
       "4      5   王芳    1038     30     32    62  0.0289  0.0308  0.0597     419   \n",
       "23    24   张丽    1040     43     15    58  0.0413  0.0144  0.0558     572   \n",
       "27    28  王秀兰    1028     42     15    57  0.0409  0.0146  0.0554     491   \n",
       "13    14   王娟    1045     25     31    56  0.0239  0.0297  0.0536     462   \n",
       "20    21   张磊    1044     27     28    55  0.0259  0.0268  0.0527     552   \n",
       "3      4   李强    1006     36     15    51  0.0358  0.0149  0.0507     433   \n",
       "25    26   王敏    1081     32     16    48  0.0296  0.0148  0.0444     491   \n",
       "\n",
       "    ...     跟单失败率    底薪  直接成单奖励  跟单成功奖励  直接成单数最高者奖励  跟单成功率最高者奖励  跟单成功数最高者奖励  \\\n",
       "28  ...    0.1441  2000    8200    3680           0           0           0   \n",
       "16  ...    0.1870  2000    8400    1520        2000           0           0   \n",
       "8   ...    0.1327  2000    8300    3040           0           0           0   \n",
       "10  ...    0.1354  2000    2400    4800           0        1600        1600   \n",
       "11  ...    0.1547  2000    7700    2640           0           0           0   \n",
       "0   ...    0.1377  2000    6600    2880           0           0           0   \n",
       "18  ...    0.1526  2000    5900    3280           0           0           0   \n",
       "19  ...    0.1817  2000    7500    1600           0           0           0   \n",
       "6   ...    0.1610  2000    7100    1920           0           0           0   \n",
       "12  ...    0.1694  2000    5500    3280           0           0           0   \n",
       "29  ...    0.1663  2000    6500    2000           0           0           0   \n",
       "26  ...    0.1568  2000    6100    1840           0           0           0   \n",
       "21  ...    0.1809  2000    5100    2560           0           0           0   \n",
       "14  ...    0.1828  2000    5800    1760           0           0           0   \n",
       "22  ...    0.1574  2000    3200    3840           0           0           0   \n",
       "24  ...    0.1641  2000    4700    2240           0           0           0   \n",
       "7   ...    0.1510  2000    4600    2320           0           0           0   \n",
       "17  ...    0.1610  2000    5600    1280           0           0           0   \n",
       "5   ...    0.1796  2000    5000    1760           0           0           0   \n",
       "1   ...    0.1894  2000    5400    1280           0           0           0   \n",
       "15  ...    0.1598  2000    5000    1520           0           0           0   \n",
       "9   ...    0.1897  2000    4300    2160           0           0           0   \n",
       "2   ...    0.1544  2000    4500    1120           0           0           0   \n",
       "4   ...    0.1378  2000    3000    2560           0           0           0   \n",
       "23  ...    0.2125  2000    4300    1200           0           0           0   \n",
       "27  ...    0.1722  2000    4200    1200           0           0           0   \n",
       "13  ...    0.1550  2000    2500    2480           0           0           0   \n",
       "20  ...    0.1887  2000    2700    2240           0           0           0   \n",
       "3   ...    0.1431  2000    3600    1200           0           0           0   \n",
       "25  ...    0.1850  2000    3200    1280           0           0           0   \n",
       "\n",
       "    总成单数最高者奖励  总成单率最高者奖励    总工资  \n",
       "28       3000       3000  19880  \n",
       "16          0          0  13920  \n",
       "8           0          0  13340  \n",
       "10          0          0  12400  \n",
       "11          0          0  12340  \n",
       "0           0          0  11480  \n",
       "18          0          0  11180  \n",
       "19          0          0  11100  \n",
       "6           0          0  11020  \n",
       "12          0          0  10780  \n",
       "29          0          0  10500  \n",
       "26          0          0   9940  \n",
       "21          0          0   9660  \n",
       "14          0          0   9560  \n",
       "22          0          0   9040  \n",
       "24          0          0   8940  \n",
       "7           0          0   8920  \n",
       "17          0          0   8880  \n",
       "5           0          0   8760  \n",
       "1           0          0   8680  \n",
       "15          0          0   8520  \n",
       "9           0          0   8460  \n",
       "2           0          0   7620  \n",
       "4           0          0   7560  \n",
       "23          0          0   7500  \n",
       "27          0          0   7400  \n",
       "13          0          0   6980  \n",
       "20          0          0   6940  \n",
       "3           0          0   6800  \n",
       "25          0          0   6480  \n",
       "\n",
       "[30 rows x 22 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_data.sort_values(by=\"总工资\",ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_data.to_sql(\n",
    "    '2020-06salary',\n",
    "    conn,\n",
    "    index=False\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "writer = pd.ExcelWriter('salary.xlsx')\n",
    "df_data.to_excel(writer)\n",
    "writer.save()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
